package cn.ibizlab.odoo.core.odoo_hr.service.impl;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.math.BigInteger;
import java.util.Collection;

import lombok.extern.slf4j.Slf4j;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import cn.ibizlab.odoo.core.client.model.Ihr_job;
import cn.ibizlab.odoo.core.odoo_hr.domain.Hr_job;
import cn.ibizlab.odoo.core.odoo_hr.filter.Hr_jobSearchContext;
import cn.ibizlab.odoo.core.odoo_hr.service.IHr_jobService;
import cn.ibizlab.odoo.util.SearchResult;
import cn.ibizlab.odoo.util.log.IBIZLog;

/**
 * 实体[工作岗位] 服务对象接口实现
 */
@Slf4j
@IBIZLog
@Service
public class Hr_jobServiceImpl implements IHr_jobService {

    @Autowired
    private cn.ibizlab.odoo.core.client.service.Ihr_jobClientService hr_jobClientService;

    @Override
    public boolean update(Hr_job hr_job) {
        boolean bOk = false ;
        Ihr_job clientModel = this.convert2Model(hr_job,null);
        hr_jobClientService.update(clientModel) ;
        this.convert2Domain(clientModel,hr_job) ;
        bOk = true;
        return bOk ;
    }

    @Override
    public void removeBatch(Collection<? extends Serializable> idList, int batchSize) {

        //hr_jobClientService.removeBatch(hr_jobs) ;

    }

    @Override
    public void updateBatch(List<Hr_job> hr_jobs, int batchSize) {

        //hr_jobClientService.updateBatch(hr_jobs,batchSize) ;

    }

    @Override
    public boolean create(Hr_job hr_job) {
        boolean bOk = false ;
        Ihr_job clientModel = this.convert2Model(hr_job,null);
        hr_jobClientService.create(clientModel) ;
        this.convert2Domain(clientModel,hr_job);
        bOk = true ;

        return bOk ;
    }

    @Override
    public boolean remove(Integer id) {
        boolean bOk = false ;
        Ihr_job clientModel = hr_jobClientService.createModel();
        clientModel.setId(id);
        hr_jobClientService.remove(clientModel) ;
        bOk = true ;
        return bOk ;
    }

    @Override
    public Hr_job get(Integer id) {
        Ihr_job clientModel = hr_jobClientService.createModel();
        clientModel.setId(id);
        hr_jobClientService.get(clientModel) ;
        return this.convert2Domain(clientModel,null);
    }

    @Override
    public Hr_job get(Hr_job hr_job) {
        Hr_job rethr_job = this.get(hr_job.getId()) ;
    	BeanCopier copier=BeanCopier.create(rethr_job.getClass(), hr_job.getClass(), false);
        copier.copy(rethr_job, hr_job, null);
        return hr_job ;
    }

    @Override
    public void createBatch(List<Hr_job> hr_jobs, int batchSize) {

                        //hr_jobClientService.createBatch(hr_jobs,batchSize) ;

    }

    /**
     * 查询集合 默认查询
     */
    @Override
    public Page<Hr_job> searchDefault(Hr_jobSearchContext context) {
        List<Hr_job> list = new ArrayList<Hr_job>();
        Page<cn.ibizlab.odoo.core.client.model.Ihr_job> clientModelList = hr_jobClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ihr_job clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Hr_job>(list, context.getPageable(), clientModelList.getTotalElements());
    }


    /**
     * 根据HR 部门查询
     */
    @Override
    public Page<Hr_job> selectByOdoo_department(Integer id){
        Hr_jobSearchContext context = new Hr_jobSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Hr_job> list = new ArrayList<Hr_job>();
        Page<cn.ibizlab.odoo.core.client.model.Ihr_job> clientModelList = hr_jobClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ihr_job clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Hr_job>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据员工查询
     */
    @Override
    public Page<Hr_job> selectByOdoo_manager(Integer id){
        Hr_jobSearchContext context = new Hr_jobSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Hr_job> list = new ArrayList<Hr_job>();
        Page<cn.ibizlab.odoo.core.client.model.Ihr_job> clientModelList = hr_jobClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ihr_job clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Hr_job>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据EMail别名查询
     */
    @Override
    public Page<Hr_job> selectByOdoo_alias(Integer id){
        Hr_jobSearchContext context = new Hr_jobSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Hr_job> list = new ArrayList<Hr_job>();
        Page<cn.ibizlab.odoo.core.client.model.Ihr_job> clientModelList = hr_jobClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ihr_job clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Hr_job>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据公司查询
     */
    @Override
    public Page<Hr_job> selectByOdoo_company(Integer id){
        Hr_jobSearchContext context = new Hr_jobSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Hr_job> list = new ArrayList<Hr_job>();
        Page<cn.ibizlab.odoo.core.client.model.Ihr_job> clientModelList = hr_jobClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ihr_job clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Hr_job>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据联系人查询
     */
    @Override
    public Page<Hr_job> selectByOdoo_address(Integer id){
        Hr_jobSearchContext context = new Hr_jobSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Hr_job> list = new ArrayList<Hr_job>();
        Page<cn.ibizlab.odoo.core.client.model.Ihr_job> clientModelList = hr_jobClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ihr_job clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Hr_job>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据用户查询
     */
    @Override
    public Page<Hr_job> selectByOdoo_create(Integer id){
        Hr_jobSearchContext context = new Hr_jobSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Hr_job> list = new ArrayList<Hr_job>();
        Page<cn.ibizlab.odoo.core.client.model.Ihr_job> clientModelList = hr_jobClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ihr_job clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Hr_job>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据用户查询
     */
    @Override
    public Page<Hr_job> selectByOdoo_hr_responsible(Integer id){
        Hr_jobSearchContext context = new Hr_jobSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Hr_job> list = new ArrayList<Hr_job>();
        Page<cn.ibizlab.odoo.core.client.model.Ihr_job> clientModelList = hr_jobClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ihr_job clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Hr_job>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据用户查询
     */
    @Override
    public Page<Hr_job> selectByOdoo_user(Integer id){
        Hr_jobSearchContext context = new Hr_jobSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Hr_job> list = new ArrayList<Hr_job>();
        Page<cn.ibizlab.odoo.core.client.model.Ihr_job> clientModelList = hr_jobClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ihr_job clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Hr_job>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据用户查询
     */
    @Override
    public Page<Hr_job> selectByOdoo_write(Integer id){
        Hr_jobSearchContext context = new Hr_jobSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Hr_job> list = new ArrayList<Hr_job>();
        Page<cn.ibizlab.odoo.core.client.model.Ihr_job> clientModelList = hr_jobClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ihr_job clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Hr_job>(list, context.getPageable(), clientModelList.getTotalElements());

    }



    public Ihr_job convert2Model(Hr_job domain , Ihr_job model) {
        if(domain == null)
            return model ;
        if(model==null){
            model = hr_jobClientService.createModel() ;
        }

         if(domain.getMessage_is_followerDirtyFlag())
            model.setMessage_is_follower(domain.getMessage_is_follower());
         if(domain.getNo_of_employeeDirtyFlag())
            model.setNo_of_employee(domain.getNo_of_employee());
         if(domain.getStateDirtyFlag())
            model.setState(domain.getState());
         if(domain.getMessage_partner_idsDirtyFlag())
            model.setMessage_partner_ids(domain.getMessage_partner_ids());
         if(domain.get__last_updateDirtyFlag())
            model.set__last_update(domain.get__last_update());
         if(domain.getNo_of_hired_employeeDirtyFlag())
            model.setNo_of_hired_employee(domain.getNo_of_hired_employee());
         if(domain.getMessage_unread_counterDirtyFlag())
            model.setMessage_unread_counter(domain.getMessage_unread_counter());
         if(domain.getWebsite_meta_descriptionDirtyFlag())
            model.setWebsite_meta_description(domain.getWebsite_meta_description());
         if(domain.getNo_of_recruitmentDirtyFlag())
            model.setNo_of_recruitment(domain.getNo_of_recruitment());
         if(domain.getWrite_dateDirtyFlag())
            model.setWrite_date(domain.getWrite_date());
         if(domain.getIs_seo_optimizedDirtyFlag())
            model.setIs_seo_optimized(domain.getIs_seo_optimized());
         if(domain.getMessage_channel_idsDirtyFlag())
            model.setMessage_channel_ids(domain.getMessage_channel_ids());
         if(domain.getMessage_main_attachment_idDirtyFlag())
            model.setMessage_main_attachment_id(domain.getMessage_main_attachment_id());
         if(domain.getNameDirtyFlag())
            model.setName(domain.getName());
         if(domain.getDisplay_nameDirtyFlag())
            model.setDisplay_name(domain.getDisplay_name());
         if(domain.getDescriptionDirtyFlag())
            model.setDescription(domain.getDescription());
         if(domain.getWebsite_urlDirtyFlag())
            model.setWebsite_url(domain.getWebsite_url());
         if(domain.getRequirementsDirtyFlag())
            model.setRequirements(domain.getRequirements());
         if(domain.getWebsite_meta_titleDirtyFlag())
            model.setWebsite_meta_title(domain.getWebsite_meta_title());
         if(domain.getApplication_countDirtyFlag())
            model.setApplication_count(domain.getApplication_count());
         if(domain.getApplication_idsDirtyFlag())
            model.setApplication_ids(domain.getApplication_ids());
         if(domain.getIs_publishedDirtyFlag())
            model.setIs_published(domain.getIs_published());
         if(domain.getMessage_has_error_counterDirtyFlag())
            model.setMessage_has_error_counter(domain.getMessage_has_error_counter());
         if(domain.getWebsite_meta_og_imgDirtyFlag())
            model.setWebsite_meta_og_img(domain.getWebsite_meta_og_img());
         if(domain.getExpected_employeesDirtyFlag())
            model.setExpected_employees(domain.getExpected_employees());
         if(domain.getCreate_dateDirtyFlag())
            model.setCreate_date(domain.getCreate_date());
         if(domain.getWebsite_publishedDirtyFlag())
            model.setWebsite_published(domain.getWebsite_published());
         if(domain.getMessage_idsDirtyFlag())
            model.setMessage_ids(domain.getMessage_ids());
         if(domain.getMessage_attachment_countDirtyFlag())
            model.setMessage_attachment_count(domain.getMessage_attachment_count());
         if(domain.getWebsite_descriptionDirtyFlag())
            model.setWebsite_description(domain.getWebsite_description());
         if(domain.getIdDirtyFlag())
            model.setId(domain.getId());
         if(domain.getWebsite_message_idsDirtyFlag())
            model.setWebsite_message_ids(domain.getWebsite_message_ids());
         if(domain.getColorDirtyFlag())
            model.setColor(domain.getColor());
         if(domain.getMessage_follower_idsDirtyFlag())
            model.setMessage_follower_ids(domain.getMessage_follower_ids());
         if(domain.getMessage_unreadDirtyFlag())
            model.setMessage_unread(domain.getMessage_unread());
         if(domain.getDocument_idsDirtyFlag())
            model.setDocument_ids(domain.getDocument_ids());
         if(domain.getMessage_needactionDirtyFlag())
            model.setMessage_needaction(domain.getMessage_needaction());
         if(domain.getMessage_needaction_counterDirtyFlag())
            model.setMessage_needaction_counter(domain.getMessage_needaction_counter());
         if(domain.getMessage_has_errorDirtyFlag())
            model.setMessage_has_error(domain.getMessage_has_error());
         if(domain.getEmployee_idsDirtyFlag())
            model.setEmployee_ids(domain.getEmployee_ids());
         if(domain.getDocuments_countDirtyFlag())
            model.setDocuments_count(domain.getDocuments_count());
         if(domain.getWebsite_idDirtyFlag())
            model.setWebsite_id(domain.getWebsite_id());
         if(domain.getWebsite_meta_keywordsDirtyFlag())
            model.setWebsite_meta_keywords(domain.getWebsite_meta_keywords());
         if(domain.getAlias_defaultsDirtyFlag())
            model.setAlias_defaults(domain.getAlias_defaults());
         if(domain.getAlias_nameDirtyFlag())
            model.setAlias_name(domain.getAlias_name());
         if(domain.getAlias_force_thread_idDirtyFlag())
            model.setAlias_force_thread_id(domain.getAlias_force_thread_id());
         if(domain.getAlias_domainDirtyFlag())
            model.setAlias_domain(domain.getAlias_domain());
         if(domain.getWrite_uid_textDirtyFlag())
            model.setWrite_uid_text(domain.getWrite_uid_text());
         if(domain.getAlias_parent_model_idDirtyFlag())
            model.setAlias_parent_model_id(domain.getAlias_parent_model_id());
         if(domain.getCreate_uid_textDirtyFlag())
            model.setCreate_uid_text(domain.getCreate_uid_text());
         if(domain.getAlias_parent_thread_idDirtyFlag())
            model.setAlias_parent_thread_id(domain.getAlias_parent_thread_id());
         if(domain.getAlias_model_idDirtyFlag())
            model.setAlias_model_id(domain.getAlias_model_id());
         if(domain.getAddress_id_textDirtyFlag())
            model.setAddress_id_text(domain.getAddress_id_text());
         if(domain.getAlias_user_idDirtyFlag())
            model.setAlias_user_id(domain.getAlias_user_id());
         if(domain.getDepartment_id_textDirtyFlag())
            model.setDepartment_id_text(domain.getDepartment_id_text());
         if(domain.getCompany_id_textDirtyFlag())
            model.setCompany_id_text(domain.getCompany_id_text());
         if(domain.getUser_id_textDirtyFlag())
            model.setUser_id_text(domain.getUser_id_text());
         if(domain.getManager_id_textDirtyFlag())
            model.setManager_id_text(domain.getManager_id_text());
         if(domain.getAlias_contactDirtyFlag())
            model.setAlias_contact(domain.getAlias_contact());
         if(domain.getHr_responsible_id_textDirtyFlag())
            model.setHr_responsible_id_text(domain.getHr_responsible_id_text());
         if(domain.getCompany_idDirtyFlag())
            model.setCompany_id(domain.getCompany_id());
         if(domain.getWrite_uidDirtyFlag())
            model.setWrite_uid(domain.getWrite_uid());
         if(domain.getManager_idDirtyFlag())
            model.setManager_id(domain.getManager_id());
         if(domain.getAddress_idDirtyFlag())
            model.setAddress_id(domain.getAddress_id());
         if(domain.getCreate_uidDirtyFlag())
            model.setCreate_uid(domain.getCreate_uid());
         if(domain.getHr_responsible_idDirtyFlag())
            model.setHr_responsible_id(domain.getHr_responsible_id());
         if(domain.getDepartment_idDirtyFlag())
            model.setDepartment_id(domain.getDepartment_id());
         if(domain.getAlias_idDirtyFlag())
            model.setAlias_id(domain.getAlias_id());
         if(domain.getUser_idDirtyFlag())
            model.setUser_id(domain.getUser_id());
        return model ;
    }

    public Hr_job convert2Domain( Ihr_job model ,Hr_job domain) {
        if(model == null)
            return domain ;
        if(domain == null){
            domain = new Hr_job();
        }

        if(model.getMessage_is_followerDirtyFlag())
            domain.setMessage_is_follower(model.getMessage_is_follower());
        if(model.getNo_of_employeeDirtyFlag())
            domain.setNo_of_employee(model.getNo_of_employee());
        if(model.getStateDirtyFlag())
            domain.setState(model.getState());
        if(model.getMessage_partner_idsDirtyFlag())
            domain.setMessage_partner_ids(model.getMessage_partner_ids());
        if(model.get__last_updateDirtyFlag())
            domain.set__last_update(model.get__last_update());
        if(model.getNo_of_hired_employeeDirtyFlag())
            domain.setNo_of_hired_employee(model.getNo_of_hired_employee());
        if(model.getMessage_unread_counterDirtyFlag())
            domain.setMessage_unread_counter(model.getMessage_unread_counter());
        if(model.getWebsite_meta_descriptionDirtyFlag())
            domain.setWebsite_meta_description(model.getWebsite_meta_description());
        if(model.getNo_of_recruitmentDirtyFlag())
            domain.setNo_of_recruitment(model.getNo_of_recruitment());
        if(model.getWrite_dateDirtyFlag())
            domain.setWrite_date(model.getWrite_date());
        if(model.getIs_seo_optimizedDirtyFlag())
            domain.setIs_seo_optimized(model.getIs_seo_optimized());
        if(model.getMessage_channel_idsDirtyFlag())
            domain.setMessage_channel_ids(model.getMessage_channel_ids());
        if(model.getMessage_main_attachment_idDirtyFlag())
            domain.setMessage_main_attachment_id(model.getMessage_main_attachment_id());
        if(model.getNameDirtyFlag())
            domain.setName(model.getName());
        if(model.getDisplay_nameDirtyFlag())
            domain.setDisplay_name(model.getDisplay_name());
        if(model.getDescriptionDirtyFlag())
            domain.setDescription(model.getDescription());
        if(model.getWebsite_urlDirtyFlag())
            domain.setWebsite_url(model.getWebsite_url());
        if(model.getRequirementsDirtyFlag())
            domain.setRequirements(model.getRequirements());
        if(model.getWebsite_meta_titleDirtyFlag())
            domain.setWebsite_meta_title(model.getWebsite_meta_title());
        if(model.getApplication_countDirtyFlag())
            domain.setApplication_count(model.getApplication_count());
        if(model.getApplication_idsDirtyFlag())
            domain.setApplication_ids(model.getApplication_ids());
        if(model.getIs_publishedDirtyFlag())
            domain.setIs_published(model.getIs_published());
        if(model.getMessage_has_error_counterDirtyFlag())
            domain.setMessage_has_error_counter(model.getMessage_has_error_counter());
        if(model.getWebsite_meta_og_imgDirtyFlag())
            domain.setWebsite_meta_og_img(model.getWebsite_meta_og_img());
        if(model.getExpected_employeesDirtyFlag())
            domain.setExpected_employees(model.getExpected_employees());
        if(model.getCreate_dateDirtyFlag())
            domain.setCreate_date(model.getCreate_date());
        if(model.getWebsite_publishedDirtyFlag())
            domain.setWebsite_published(model.getWebsite_published());
        if(model.getMessage_idsDirtyFlag())
            domain.setMessage_ids(model.getMessage_ids());
        if(model.getMessage_attachment_countDirtyFlag())
            domain.setMessage_attachment_count(model.getMessage_attachment_count());
        if(model.getWebsite_descriptionDirtyFlag())
            domain.setWebsite_description(model.getWebsite_description());
        if(model.getIdDirtyFlag())
            domain.setId(model.getId());
        if(model.getWebsite_message_idsDirtyFlag())
            domain.setWebsite_message_ids(model.getWebsite_message_ids());
        if(model.getColorDirtyFlag())
            domain.setColor(model.getColor());
        if(model.getMessage_follower_idsDirtyFlag())
            domain.setMessage_follower_ids(model.getMessage_follower_ids());
        if(model.getMessage_unreadDirtyFlag())
            domain.setMessage_unread(model.getMessage_unread());
        if(model.getDocument_idsDirtyFlag())
            domain.setDocument_ids(model.getDocument_ids());
        if(model.getMessage_needactionDirtyFlag())
            domain.setMessage_needaction(model.getMessage_needaction());
        if(model.getMessage_needaction_counterDirtyFlag())
            domain.setMessage_needaction_counter(model.getMessage_needaction_counter());
        if(model.getMessage_has_errorDirtyFlag())
            domain.setMessage_has_error(model.getMessage_has_error());
        if(model.getEmployee_idsDirtyFlag())
            domain.setEmployee_ids(model.getEmployee_ids());
        if(model.getDocuments_countDirtyFlag())
            domain.setDocuments_count(model.getDocuments_count());
        if(model.getWebsite_idDirtyFlag())
            domain.setWebsite_id(model.getWebsite_id());
        if(model.getWebsite_meta_keywordsDirtyFlag())
            domain.setWebsite_meta_keywords(model.getWebsite_meta_keywords());
        if(model.getAlias_defaultsDirtyFlag())
            domain.setAlias_defaults(model.getAlias_defaults());
        if(model.getAlias_nameDirtyFlag())
            domain.setAlias_name(model.getAlias_name());
        if(model.getAlias_force_thread_idDirtyFlag())
            domain.setAlias_force_thread_id(model.getAlias_force_thread_id());
        if(model.getAlias_domainDirtyFlag())
            domain.setAlias_domain(model.getAlias_domain());
        if(model.getWrite_uid_textDirtyFlag())
            domain.setWrite_uid_text(model.getWrite_uid_text());
        if(model.getAlias_parent_model_idDirtyFlag())
            domain.setAlias_parent_model_id(model.getAlias_parent_model_id());
        if(model.getCreate_uid_textDirtyFlag())
            domain.setCreate_uid_text(model.getCreate_uid_text());
        if(model.getAlias_parent_thread_idDirtyFlag())
            domain.setAlias_parent_thread_id(model.getAlias_parent_thread_id());
        if(model.getAlias_model_idDirtyFlag())
            domain.setAlias_model_id(model.getAlias_model_id());
        if(model.getAddress_id_textDirtyFlag())
            domain.setAddress_id_text(model.getAddress_id_text());
        if(model.getAlias_user_idDirtyFlag())
            domain.setAlias_user_id(model.getAlias_user_id());
        if(model.getDepartment_id_textDirtyFlag())
            domain.setDepartment_id_text(model.getDepartment_id_text());
        if(model.getCompany_id_textDirtyFlag())
            domain.setCompany_id_text(model.getCompany_id_text());
        if(model.getUser_id_textDirtyFlag())
            domain.setUser_id_text(model.getUser_id_text());
        if(model.getManager_id_textDirtyFlag())
            domain.setManager_id_text(model.getManager_id_text());
        if(model.getAlias_contactDirtyFlag())
            domain.setAlias_contact(model.getAlias_contact());
        if(model.getHr_responsible_id_textDirtyFlag())
            domain.setHr_responsible_id_text(model.getHr_responsible_id_text());
        if(model.getCompany_idDirtyFlag())
            domain.setCompany_id(model.getCompany_id());
        if(model.getWrite_uidDirtyFlag())
            domain.setWrite_uid(model.getWrite_uid());
        if(model.getManager_idDirtyFlag())
            domain.setManager_id(model.getManager_id());
        if(model.getAddress_idDirtyFlag())
            domain.setAddress_id(model.getAddress_id());
        if(model.getCreate_uidDirtyFlag())
            domain.setCreate_uid(model.getCreate_uid());
        if(model.getHr_responsible_idDirtyFlag())
            domain.setHr_responsible_id(model.getHr_responsible_id());
        if(model.getDepartment_idDirtyFlag())
            domain.setDepartment_id(model.getDepartment_id());
        if(model.getAlias_idDirtyFlag())
            domain.setAlias_id(model.getAlias_id());
        if(model.getUser_idDirtyFlag())
            domain.setUser_id(model.getUser_id());
        return domain ;
    }


}
